<template>
  <!--  -->
  <layout title="提现">
    <view class="withdrawalResult">
      <view class="withdrawalResult-body">
        <image
          class="withdrawalResult-cover"
          :src="statusImg"
          mode="widthFix"
        />
        <view>{{ statusText }}</view>
      </view>
      <view class="withdrawalResult-form">
        <view class="withdrawalResult-form-item">
          <view class="withdrawalResult-form-item-wrap">
            <view class="w-label">提现金额</view>
            <view class="w-value">￥{{fee}}</view>
          </view>
          <view class="withdrawalResult-form-item-wrap">
            <view class="w-label">提现到</view>
            <view class="w-value">{{type}}</view>
          </view>
        </view>
      </view>

      <button class="withdrawalResult-btn" @tap="triggerToSubmit">确定</button>
    </view>
  </layout>
</template>
<script>
export default {
  name: "withdrawal-result",
  components: {},
  data() {
    return {
      type: '',
      fee: 0
    };
  },
  onLoad(option) {
    this.fee = option.fee || 0;
    this.type = option.type === '4' ? '银行卡' : '支付宝';
  },
  created() {
    this.triggerToFetch();
  },
  onShow() {},
  watch: {},
  computed: {
    statusText() {
      return "提现申请成功，等待平台审核"; // 审核中
      // return "提现申请失败";// 提现申请失败
      // return "审核成功，提现已到账";// 提现成功
      // return "提现到账失败"; // 提现失败
    },
    statusImg() {
      // 等待
      return this.getImgSrc("/user/wallet_wait@2x.png"); // 审核中
      // return getImgSrc("/user/wallet_fail@2x.png"); // 提现申请失败
      // return getImgSrc("/user/wallet_succeed@2x.png"); // 提现成功
      // return getImgSrc("/user/wallet_succeed2@2x.png"); // 提现失败
    },
  },
  methods: {
    async triggerToFetch() {
      // 获取钱包余额
      this.$u.api.queryWalletType().then((res) => {
        this.operatorList = res.data.type || [];
      });
    },
    triggerToSubmit() {
      uni.redirectTo({
        url: '/pages/sys/user/wallet'
      })
    },
  },
};
</script>
<style lang="scss" scoped>
.withdrawalResult {
  min-height: 100vh;
  &-form {
    margin: 30rpx 60rpx 112rpx 60rpx;
    overflow: hidden;
    &-item {
      &-wrap {
        border-bottom: 1rpx solid #eaeaea;
        padding: 36rpx 0;
        display: flex;
        justify-content: space-between;
        padding-bottom: 36rpx;
        font-size: 30rpx;
        font-family: PingFang SC;
        font-weight: 400;
        color: #4b4b4b;
        line-height: 36rpx;
        .w-value {
          display: flex;
          justify-content: flex-end;
          align-items: center;
          image {
            margin-left: 33rpx;
            width: 24rpx;
            height: 24rpx;
          }
        }
      }
    }
  }

  &-body {
    text-align: center;
    view {
      font-size: 34rpx;
      font-family: PingFang SC;
      font-weight: 400;
      color: #282828;
      line-height: 36rpx;
      margin-bottom: 140rpx;
    }
  }
  &-cover {
    margin: 146rpx auto 34rpx;
    width: 286rpx;
    height: 190rpx;
  }

  &-btn {
    margin: 60rpx auto;
    width: 690rpx;
    height: 96rpx;
    background-image: linear-gradient(90deg, #4aabf6, #4675f6);
    box-shadow: 0rpx 16rpx 30rpx 0rpx rgba(74, 169, 246, 0.2);
    border-radius: 47rpx;

    font-size: 34rpx;
    font-family: PingFang SC;
    font-weight: 400;
    color: #ffffff;
    line-height: 96rpx;

    &[disabled] {
      background-color: #eaeaea;
      background-image: none;
      color: #fff;
      box-shadow: none;
      &::after {
        content: none;
      }
    }
  }
}
</style>
